const baseurl="https://vue3antdv-7gcma6b228a5b287-1256680780.tcloudbaseapp.com/api/v2/";
Page({
    data:{
        start:0,
        count:5,
    },
    onLoad(option){
        this.setData({
            type:option.type,
            id:option.id
        })
        let xq=baseurl+option.type+'/'+option.id
        let bq=baseurl+option.type+'/'+option.id+'/tags?count=5'
        let dp=baseurl+option.type+'/'+option.id+'/interests?count=5'

        wx.request({
          url:xq,
          success:res=>{
              let mygenres=res.data.genres.join('/')
              let myactors=res.data.actors.slice(0,3).map(v=>{
                  return v.name
              }).join('/')
              //console.log(res);
              this.setData({
                  xq:res.data,
                  mygenres,
                  myactors
              })
          }
        })
        wx.request({
            url:bq,
            success:res=>{
                console.log(res);
                this.setData({
                    bq:res.data
                })
            }
          })
          wx.request({
            url:dp,
            success:res=>{
                console.log('dp',res);
                let dptotal=res.data.total
                this.setData({
                    dp:res.data.iinterest,
                    dptotal
                })
            }
          })
    },
    //onReachBottom(){
        //this.setData({
            //start:this.data.start+this.data.count
        //})
        //let dp=baseurl+this.data.type+'/'+this.data.id+'/interests?start='+this.data.start+'&count='+this.data.count
        //wx.request({
          //url:dp,
          //success:res=> {
            //let newdp=res.data.interests
            //let dp=this.data.dp.concat(newdp)
            //this.setData({
                //dp
            //})   
          //}
        //})
    //}
})

